Clipping processing device, three-dimensional simulator device, and clipping processing method

ABSTRACT

An optimized, fast clipping processing device for a 3D simulator device performs real-time image processing. An initial value is set in a priority register (170) by an initial-value setting section (152) and clipping surface index data is stored from an uppermost register toward lower registers. Clipping calculation for a polygon is performed by a clipping calculation section (200), using a clipping surface from index data read out sequentially by a reading section (190). If clip-out occurs with a certain clipping surface, index data for that clipping surface is written to an uppermost register of the priority register (170), and index data stored in lower registers is written sequentially downward. As a result, the priorities stored in the priority register (170) can be optimized, enabling the implementation of a faster clipping processing device.

TECHNICAL FIELD

This invention relates to a clipping processing device, athree-dimensional (3D) simulator device that uses such a clippingprocessing device, and a clipping processing method.

BACKGROUND OF ART

Various applications are known in the prior art as 3D simulator devicesused in, for example, 3D games or piloting simulators for aircraft orvarious vehicle. In a 3D simulator device shown in FIG. 9, imageinformation relating to a 3D object 300 is previously stored in thedevice. This 3D object 300 represents a display object that a player(observer) 302 can see via a screen 306. Image Information of the 3Dobject 300 is subjected to perspective projection conversion on thescreen 306 so that a pseudo-3D image (projected image) 308 is displayedon the screen 306. With this device, if the player 302 performs anoperation such as a rotation or translation using a control panel 304,given 3D calculation processing is performed on the basis of a controlsignal thereof. A calculation is first performed to determine whetherthere is a change in a factor such as the viewpoint position orline-of-sight direction of the player 302 or the position or directionof the moving vehicle in which the player 302 is seated. Next, acalculation is performed to determine how the image of the 3D object 300will appear on the screen 306 in response to this change in theviewpoint position and line-of-sight direction, or other change. Theabove calculation processing is performed in real time to follow theactions of the player 302. This enables the player 302 to experience avirtual 3D space in which a change in scenery concomitant with a changein the player's own viewpoint position and line-of-sight direction or achange in the position and direction of the moving vehicle can be seenin real time as a pseudo-3D image.

An example of the 3D simulator device of this invention is shown in FIG.18. Note that the description below proceeds on the assumption that the3D simulator device is applied to a 3D game.

As shown in FIG. 18, the 3D simulator device of this invention isconfigured of a control section 510, a virtual 3D space calculationsection 500, an image synthesis section 512, and a CRT 518.

The virtual 3D space calculation section 500 sets a virtual 3D space inaccordance with control signals from the control section 510 and a gamesprogram stored in a central processing section 506. In other words, itperforms calculations to determine what the position of the 3D object300 is and in what direction is it arranged.

The image synthesis section 512 comprises an image supply section 514and an image forming section 516. The image synthesis section 512performs image synthesis of a pseudo-3D image in accordance with settinginformation on a virtual 3D space from a virtual 3D space calculationsection 500.

3D objects that configure a virtual 3D space are represented by this 3Dsimulator device as polyhedrons divided into 3D polygons. For example,the 3D object 300 shown in FIG. 17 is represented as a polyhedrondivided into 3D polygons (1) to (6) (polygons (4) to (6) are not shownin the figure). Coordinates and accompanying data (hereinafter calledvertex image information) for each vertex of these 3D polygons arestored in a 3D image information memory section 552.

Various types of calculation such as rotation or translation withrespect to this vertex image information and various types of coordinateconversion such as perspective projection conversion are performed bythe image supply section 514 in accordance with setting information ofthe virtual 3D space calculation section 500. After the vertex imageinformation that has been subjected to this calculation processing hasbeen converted in line with a given sequence, it is output to the imageforming section 516.

The image forming section 516 comprises a polygon generation circuit 570and a palette circuit 580, and the polygon generation circuit 570comprises an outline point calculation section 324 and a line processor326. Calculation processing to paint the dots within polygons with givencolor data is performed by the image forming section 516 in the sequencedescribed below.

First of all, left and right outline points that are the intersectionsbetween the outline of a polygon and a scan line are calculated in theoutline point calculation section 324. The portion bounded by these leftand right outline points is then painted in the specified color by theline processor 326. The thus-painted color data is subsequentlyconverted into RGB data in the palette circuit 580 and is output to theCRT 518.

With the 3D simulator device of the above configuration, thecalculations described below are performed by the image supply section514.

Taking a driving game as an example, as shown in FIG. 19, 3D objects300, 333, and 334 representing objects such as a steering wheel, abuilding, and a billboard, which are read out from the 3D imageinformation memory section 552 are arranged in a 3D space expressed by aworld coordinate system (XW, YW, ZW). Subsequently, image informationrepresenting those 3D objects is subjected to coordinate conversion to aviewpoint coordinate system (Xv, Yv, Zv) based on the viewpoint of theplayer 302.

Next, a type of image processing that is called clipping processing isperformed. Clipping processing is image processing whereby imageinformation that is outside the field of view of the player 302 (oroutside the field of view of a window opening into the 3D space), inother words, image information that is outside a region bounded byclipping surfaces 1, 2, 3, 4, 5, and 6 (hereinafter called a displayregion 20), is excluded. The image information necessary for subsequentprocessing by this 3D simulator device is only the image informationthat is within the field of view of the player 302. This means that, ifall other information could be excluded, the load during subsequentprocessing could be reduced. Although there are objects in alldirections around the player 302, if it could be arranged such that onlythose of the objects that are within the field of view are processed,the quantity of data to be processed subsequently can be greatlyreduced, so that the 3D simulator device executes only essential imageprocessing during real-time image processing.

This is described below in more detail with reference to FIG. 19. Imageinformation on an object outside the field of view of the player 302(outside the display region 20), such as the 3D object 334 representinga billboard that has moved out of the field of view and backwards, isexcluded. This exclusion processing is performed by determining whetheror not an object is within a display region for each of the clippingsurfaces 1 to 6, then excluding the object only if it is outside all ofthose surfaces.

In contrast thereto, for the 3D object 333 of a building or the likethat is on the boundary of the display region 20, the part thereof thatis outside the display region 20 is excluded, and only the part that iswithin the display region 20 is used in subsequent image processing. Theimage information of the 3D object 300 of the steering wheel or thelike, which is completely included within the display region 20, is usedas is in the subsequent image processing.

Finally, perspective projection conversion to the screen coordinatesystem (XS, YS) is performed only for objects within the display region20, then sorting processing is performed.

Since the clipping processing ensures a huge reduction in the amount ofimage data used in the image processing after the clipping processing,this type of 3D simulator device can perform essential image processing.

However, as shown in FIG. 19, this clipping processing has to beperformed for all of the clipping surfaces 1 to 6, and in practice theimage processing regulates the speed of the entire circuitry of this 3Dcalculation section 316 the most.

In particular, a 3D simulator device that has to perform imageprocessing of a pseudo-3D image in real time, in other words a devicecreates a display screen every 1/60 second, a drop in speed will leaddirectly to a deterioration in image quality, causing major problems.Thus the implementation of faster, optimized clipping processing forthis type of 3D simulator device has become the technical subject.

DISCLOSURE OF THE INVENTION

This invention has been devised in the light of the above technicalconcerns and has as its objective the provision of an optimized, fastclipping processing device, particularly for a three-dimensionalsimulator device that performs real-time image processing.

In order to achieve this objective, a first aspect of this inventionconcerns a clipping processing device for performing clipping processingusing a plurality of clipping surfaces on a three-dimensional objectrepresented by a plurality of polygons, comprising:

a priority memory means for storing clipping surface priorities whichhas a storage means for storing index data specifying the clippingsurfaces to be used in clipping processing, and stores the index data ina sequence in which clipping processing is executed, starting at anuppermost storage location of the storage means and proceeding downward;

an initial-value setting means for setting an initial value for theindex data with respect to the priority memory means;

a reading means for reading said index data of the clipping surface fromthe priority memory means;

a priority modification means for modifying said index data that hasbeen read by the reading means and rewriting modified data to thepriority memory means; and

a clipping calculation means for performing clipping calculation withrespect to a polygon to be processed, using said clipping surfacesspecified by said index data read out by the reading means in sequencefrom the uppermost storage location of the storage means; wherein:

the clipping calculation means comprises inside/outside decision meansfor determining whether said polygon to be processed is in one of adisplay region, a boundary region, or an out-of-display region of theclipping surfaces; an interior-division-point calculation means forcalculating interior division points between the polygon and theclipping surface when the inside/outside decision means determines thatthe polygon is in the boundary region; and means for performingcalculation processing that invalidates the polygon when theinside/outside decision means determines that the polygon is in theout-of-display region; and

the priority modification means comprises means for transferring indexdata of the clipping surface to the uppermost storage location of thestorage means when the clipping calculation means determines that saidpolygon to be processed is in the out-of-display region of the clippingsurface.

In accordance with this aspect of the invention, an initial value forthe index data is set in the priority memory means by the initial-valuesetting means. When it is determined that a polygon to be processed isin an out-of-display region with respect to a clipping surface, indexdata of the clipping surface is transferred to the uppermost storagelocation of the storage means. As a result, when clipping processing isperformed sequentially for polygons comprising the samethree-dimensional object, the priorities written in the priority memorymeans can be optimized. This enables a statistical reduction in theclipping processing time, which can greatly increase the clippingprocessing speed. As a result, optimal clipping processing device can beprovided, particularly for a three-dimensional simulator device thatperforms real-time image synthesis.

In a second aspect of this invention, the priority modification meanscomprises means for transferring index data of the clipping surface tothe uppermost storage location of the storage means, and alsotransferring index data that have been stored in starting from theuppermost storage location and ending one position higher than anoriginal location of the index data to be transferred to the uppermoststorage location sequentially downwards to lower storage locations, whenthe clipping calculation means determines that the polygon to beprocessed is in the out-of-display region of the clipping surface.

In accordance with this aspect of the invention, when it is determinedthat a polygon to be processed is in an out-of-display region withrespect to a clipping surface, not only are index data of the clippingsurface transferred to the uppermost storage location of the storagemeans, but also the other index data are transferred sequentiallydownward to lower storage locations. This ensures that index data for aclipping surface that could easily cause clipping-out are stored insequence from the top of the storage means. As a result, if clipping-outbecomes impossible with the clipping surface specified by the uppermostindex data, clipping-out by the clipping surface specified by the nextindex data becomes possible, thus enabling a further reduction inclipping processing time.

A third aspect of this invention further comprises means for performingpreprocessing for the entirety of a 3D object, before clippingprocessing is performed on a polygon that configures thethree-dimensional object;

wherein the preprocessing means comprises:

preprocessing decision means for setting a zone for trivial clipping ofa given width shaped in such as manner as to include the clippingsurface, and determining whether the three-dimensional object is in anyof a display region, a boundary region, or an out-of-display region ofthe zone; and

means for omitting clipping processing for a polygon that configures thethree-dimensional object when the preprocessing decision meansdetermines that the three-dimensional object is in the display region orout-of-display region of the zone, and for specifying that clippingprocessing is performed for a polygon that configures thethree-dimensional object when it is determined that thethree-dimensional object is in the boundary region of the zone.

In accordance with this aspect of the invention, it is previouslydetermined whether each three-dimensional object is in one of a displayregion, boundary region, or out-of-display region of a zone for trivialclipping. If it is determined that the three-dimensional object is inthe display region or out-of-display region of this zone, clippingprocessing is not performed for the polygons of this three-dimensionalobject. As a result, the total volume of processing can be greatlyreduced, and the clipping processing speed can be greatly reduced.

In a fourth aspect of this invention, the interior-division-pointcalculation means within the clipping calculation means comprises meansfor performing perspective projection conversion with respect to apolygon to be processed, by modifying calculation coefficients that areused in interior-division-point calculation.

In accordance with this aspect of the invention, since not only clippingprocessing but also perspective projection conversion processing can beperformed by one clipping processing device, it is possible to design areduction in the scale of the hardware. As a result, the costperformance of the device can be increased.

A fifth aspect of this invention further comprises means for setting theinitial value set by the initial-value setting means for eachthree-dimensional object configured of polygons, in accordance with adisplay state of the three-dimensional object.

In accordance with this aspect of the invention, since an initial valuecan be set for the priority of each three-dimensional object, it ispossible to perform optimal clipping processing by modifying thisinitial value in accordance with the display state of thethree-dimensional object.

A sixth aspect of this invention concerns a three-dimensional simulatordevice that comprises the above described clipping processing device,wherein the three-dimensional simulator device further comprises:

an image synthesis means for synthesizing a field-of-view image as seenfrom an observer within a virtual three-dimensional space, using apolygon which has been subjected to clipping processing by the clippingprocessing device.

In accordance with this aspect of the invention, the number of polygonsthat must be handled by the image synthesis means can be greatly reducedby performing clipping processing by a clipping processing device,enabling the provision of a three-dimensional simulator device that iscapable of real-time image synthesis.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a preferred example of the clippingprocessing device according to this invention;

FIG. 2 a block diagram of an example of a 3D simulator device to whichthe clipping processing device according to this invention is applied;

FIG. 3 is a schematic diagram for illustrating the concept of texturemapping;

FIGS. 4A and 4B show an example of the format of data handled by thisembodiment;

FIG. 5 a block diagram of an example of the image supply section towhich the clipping processing device according to this invention isapplied;

FIGS. 6A, 6B, and 6C are schematic illustrative diagrams of the clippingprocessing device according to this embodiment used in re-entrant mode;

FIGS. 7A, 7B, 7C, and 7D are schematic illustrative diagrams of anexample of initial mode specification data and priority specificationdata, and the operation of overwriting data in the clipping register;

FIGS. 8A, 8B, 8C, 8D, and 8E are schematic illustrative diagramsconcerning an example of the application of the clipping processingdevice according to this embodiment;

FIG. 9 is a block diagram of the configuration of the clippingprocessing device when trivial clipping processing is performed;

FIG. 10 is a schematic diagram for illustrating the trivial clippingprocessing method;

FIG. 11 is a block diagram of a schematic circuit configuration of thepriority register (priority memory means);

FIG. 12 is a block diagram of a schematic circuit configuration of thepriority modification section;

FIGS. 13A, 13B, 13C, and 13D are schematic illustrative diagrams of theoperations of the decode signal and priority register;

FIG. 14 is a schematic diagram for illustrating the clipping calculationmethod of the clipping calculation section;

FIGS. 15 and 15(a)-15(c) are the block diagram of a schematic circuitconfiguration of the clipping calculation section;

FIGS. 16A, 16B, 16C, and 16D are schematic diagrams for illustratingincreases in processing speed by the application of prioritymodification and parallel connection;

FIG. 17 is a schematic diagram for illustrating the concept of aprior-art 3D simulator device;

FIG. 18 is a schematic block diagram of the configuration of theprior-art 3D simulator device; and

FIG. 19 is a schematic diagram for illustrating the image processingcalculations performed by the image supply section.

BEST MODE FOR CARRYING OUT THE INVENTION Table of Contents ofEmbodiments

1. Description of Overall 3D Simulator Device

2. Description of Image Supply Section

1) Initialization

2) Frame Data Transfer

3) Object Data Transfer

4) Operation of Coordinate Conversion Section, etc

3. Description of Clipping Processing Device

1) Configuration and Operation

2) Application Examples

3) Trivial Acceptance/Rejection

4. Specific Examples

1) Priority Modification Section, Priority Register, etc.

2) Clipping Calculation Section

3) Increase in Processing Speed by Priority Modification and ParallelConnection

1. Description of Overall 3D Simulator Device

The overall configuration of this 3D simulator device will first bedescribed.

As shown in FIG. 2, this 3D simulator device comprises a control section412, a virtual 3D space calculation section 413, an image synthesissection 401, and a CRT 446. The image synthesis section 401 comprises animage supply section 410 and an image forming section 428. Note that thedescription below proceeds on the assumption that the 3D simulatordevice is applied to a 3D game.

The virtual 3D space calculation section 413 sets a virtual 3D space inaccordance with control signals from the control section 412 and a gamesprogram stored in a central processing section 414. Virtual 3D spacesetting information configured of position/direction information of 3Dobjects that configure the virtual 3D space (such as an enemy aircraft,a mountain, and a building) and position/field-of-view directioninformation of the player is calculated and then output to the imagesupply section 410 within the image synthesis section 401.

Predetermined calculation processing is performed by the image supplysection 410 in accordance with this virtual 3D space settinginformation. To be specific, calculations such as coordinate conversionfrom an absolute coordinate system to a viewpoint coordinate system,clipping processing, perspective projection conversion, and sortingprocessing are performed in this section, then data is output to theimage forming section 428. In this case, the output data is expressed asdata that is divided into polygons, more specifically it is configuredof vertex image information such as position coordinates, texturecoordinates, and other accompanying information for each vertex. Theconfiguration and operation of this image supply section 410 will bedescribed in detail later.

The image forming section 428 is designed to calculate intra-polygonimage information on the basis of vertex image information provided foreach vertex of this polygon, then output it to the CRT 446

Image synthesis is performed by methods called texture mapping andGourand shading in this 3D simulator device, to provide a higher qualityimage. The concepts of these methods are described below in detail.

The concept of the texture mapping method is shown in FIG. 3.

In the prior art, to synthesize the image of a 3D object 332 havingpatterns such as checks or stripes, as shown in FIG. 3, the 3D object isdivided into 3D polygons (1) to (80) (3D polygons (41) to (80) are notshown in the figure) and image processing is performed with respect toall of these polygons, because painting out one polygon can only beperformed with one specified color. As a result, the number of polygonsrequired to synthesize a high-quality image with a complicated patternincreases greatly, and thus it becomes impossible to synthesize ahigh-quality image of this type.

With this 3D simulator device, processing such as rotation, translation,coordinate conversion for perspective projection conversion, andclipping of the 3D object 332 is performed for each of 3D polygons A, B,and C configuring the surfaces thereof, (to be specific, each of thevertices of these 3D polygons) and the checked or striped pattern ishandled as a texture that is separated from the polygon processing. Atexture information memory section 442 is provided within the imageforming section 428 shown in FIG. 2, and image information (textureinformation) to be applied to each of the 3D polygons, such as a checkedor striped pattern, is stored therein

The address in the texture information memory section 442 that specifiesthis texture information is given as texture coordinates VTX, VTY foreach vertex of each of the 3D polygons. More specifically, texturecoordinates (VTX0, VTY0), (VTX1, VTY1), (VTX2, VTY2), and (VTX3, VTY3)are specified for each vertex of polygon A shown in FIG. 3.

Texture coordinates TX, TY for all of the dots within the polygon areobtained by a processor section 430 within the image forming section 428from the texture coordinates VTX, VTY for each of these vertices.Texture information corresponding to the thus-obtained texturecoordinates TX, TY is read out from the texture information memorysection 442 and is output to the palette and mixer circuit 444. Thisenables the synthesis of a 3D object covered with a texture such aschecks or stripes, as shown in FIG. 3.

The 3D simulator device represents the 3D object 332 as a 3D polygonalsolid as described above. Therefore the continuity of brightnessinformation at boundaries of each 3D polygon causes a problem. Forexample, if an attempt is made to represent a sphere by using aplurality of 3D polygons and the same brightness is set for all the dotswithin each 3D polygon, a state would occur in which the boundaries ofeach 3D polygon would not be represented as "rounded," although it isdesired to represent them as "rounded" in practice. The 3D simulatordevice of this invention avoids this problem by a method called Gourandshading. With this method, brightness information VBRI0 to VBRI3 foreach vertex is given for each vertex of the 3D polygons, as shown inFIG. 3, in a similar manner to that of the above described texturemapping method, and brightness information for all the dots in the 3Dpolygon is obtained by interpolation from the brightness informationVBRI0 to VBRI3 for each of these vertices when the image is finallydisplayed by the image forming section 428.

As described above, the 3D simulator device is configured to use texturemapping and Gourand shading methods to enable fast image processing of ahigh-quality image. Thus the polygon image information is configured asa plurality of data items formed into a string, such as vertex displaycoordinates, vertex texture coordinates, and vertex brightnessinformation for each polygon. There is also object data that is commondata for identical 3D objects and frame data that is common data foridentical frames. An example of the data format therefor is shown inFIG. 4. However, a major technical concern concerns the question of howdata, (which consists of a plurality of data items formed into onestring, as shown in this figure) should be processed efficiently andappropriately within the image supply section 410.

Note that, in order to simplify the description below, vertex brightnessinformation items VBRI0 to VBRI3 are represented in FIG. 4 as I0 to I3;vertex texture coordinates VTX0 to VTY3 are represented as TX0 to TY3;and vertex coordinates VX0 to VI3 are represented as X0 to I3.

2. Description of Image Supply Section

The image supply section 410 comprises a processing section 415, a 3Dimage information memory section 416, a coordinate conversion section418, a clipping processing device 420, an output format conversionsection 421, and a sorting processing section 422, as shown in FIG. 5.

The description below of the configuration and operation of the imagesupply section 410 relates to an example of an application to a 3Dsimulator device for a driving game.

1) Initialization

When the power of this 3D simulator device is turned on, imageinformation for 3D objects that representing objects such as a racingcar, a steering wheel, and a road which are elements configuring thedriving game, are written to the 3D image information memory section 416from the virtual 3D space calculation section 413 (central processingsection 414) through the processing section 415. The 3D simulator deviceperforms various types of image calculation processing such ascoordinate conversion, rotation, and translation on this 3D object imageinformation to form a virtual 3D space for driving.

Note that if the 3D image information memory section 416 configured ofROM, this write is not necessary.

2) Frame Data Transfer

Viewpoint information that i s common to all of the 3D objects, in otherwords, information on the viewpoint position, angle, and angle-of-viewof the player and monitor information, is updated every frame (forexample, every 1/60 second), and is transferred from the virtual 3Dspace calculation section 413 to the coordinate conversion section 418through the processing section 415. Various types of coordinateconversion are performed on the basis of this data by the coordinateconversion section 418.

Monitor information, such as its angle and size, is also transferred asclipping processing data to the clipping processing device 420. Theclipping processing device 420 calculates factors such as clippingsurfaces for performing clipping processing on the basis of this data,and performs the clipping processing.

The thus-transferred data is called frame data, and a header is set foreach frame, as shown in FIG. 4A.

3) Object Data Transfer

In order to create the virtual 3D space, the various 3D objectsrepresenting the racing car, steering wheel, and road which are elementsconfiguring the driving game must be arranged in given positions in thevirtual 3D space. Therefore, object number and position information,which indicates which 3D object and where it is positioned, isnecessary. Data such as this object number and position information istransferred from the virtual 3D space calculation section 413 to theprocessing section 415.

Image information on the corresponding 3D object is then read out fromthe 3D image information memory section 416 as an address for thisobject number. In other words, if, for example, the object numberspecifies a racing car, image information for this racing car is readout from the 3D image information memory section 416. Image informationon elements such as a racing car is stored in the 3D image informationmemory section 416 as a plurality of polygons (a polyhedron). Theprocessing section 415 forms data that is called object data and polygondata from this read-out data in a data formatting section 417 andsequentially transfers it to the coordinate conversion section 418onward.

In this case, "object data" means position and rotation information forthe racing car that is a 3D object, and other accompanying data."Polygon data" is data in which the image information for this racingcar is divided into polygons, configured of vertex display coordinates,vertex texture coordinates, and vertex brightness information for eachpolygon, together with other accompanying data. This data is sent on bythe data formatting section 417 to the next stage in the data formatshown in FIG. 4.

Note that data for setting clipping surfaces on each object is alsoincluded within this object data, as will be described below.

4) Operation of Coordinate Conversion Section, etc

The polygon data is subjected to various types of coordinate conversionby the coordinate conversion section 418, on the basis of the player'sviewpoint information transferred from the processing section 415 andthe racing car's position and rotation information transferred from theprocessing section 415. In other words, rotation in the local coordinatesystem, parallel movement to the world coordinate system, and rotationto the viewpoint coordinate system are performed on the polygon data.

The polygon data that has been subjected to this coordinate conversionis then subjected to clipping processing by the clipping processingdevice 420. The plane equation for performing this clipping processingis that transferred as described above as frame data. Note that detailsof this clipping processing will be described later.

Each polygon that has been deformed into a polygonal shape by theclipping processing is subjected to processing by the output formatconversion section 421 that converts it into a four-sided polygon, forexample. The data whose format has been converted is output to thenext-stage sorting processing section 422.

3. Description of Clipping Processing Device

1. Configuration and Operation

The clipping processing device 420 relating to this embodiment comprisesa priority register (priority memory means) 170 that stores clippingsurface index data according to a certain priority, a reading section190 that reads index data from the priority register 170, a prioritymodification section 160 that modifies data from the priority register170, a selector 150, an initial-value setting section 152 that sets aninitial value in the priority register according to the data input fromthe selector 150, a control section 154 that controls the entire device,and a clipping calculation section 200, as shown in FIG. 1.

The clipping processing and perspective projection conversion isperformed by the clipping calculation section 200. An inside/outsidedecision is performed with respect to each of clipping surfaces 1 to 6to determine whether or not each of the polygons configuring the 3Dobjects 300, 333, and 334 shown in FIG. 19 is within the display region20.

For example, since all of the polygons configuring the 3D object 334 arecompletely outside the display region 20, the image information thereforis excluded from the data to be subjected to the subsequent imageprocessing. Since all of the polygons of the 3D object 300 are withinthe display region 20, the image information therefor is used as is inthe subsequent image processing. For the 3D object 333 that is on theboundary of the display region 20, the part thereof that is outside thedisplay region 20 is excluded, and only the part that is within thedisplay region 20 is used in subsequent image processing. In this case,the points at which the boundary cuts are calculated and new polygondata is created therefrom.

Finally, perspective projection conversion to the screen coordinatesystem (XS, YS) is performed only for objects within the display region20, then is transferred to the next stage. In this case, since clippingprocessing and perspective projection conversion are similarcalculations, mathematically speaking, the clipping calculation section200 is set up in such a manner that it can calculate this clippingprocessing and perspective projection conversion with exactly the sameconfiguration.

The clipping processing device 420 according to this embodiment isconfigured in such a manner that the clipping processing by a pluralityof clipping surfaces and perspective projection conversion can beperformed by one or a plurality of clipping processing devices.

The connections shown in the above FIGS. 1 and 5 are those for a case inwhich the clipping processing for all of the clipping surfaces and theperspective projection conversion are performed by only one clippingprocessing device 420. If such a connection configuration is used, theclipping processing device 420 operates as described below.

First of all, as shown in FIG. 6A, new data is input after data that hasbeen subjected to processing has been output, and the clippingprocessing in accordance with the first of the clipping surfaces to beused is performed. Subsequently, as shown in FIG. 6B, an internal loopconnecting the input and output is formed. This returns data that hasbeen subjected to clipping processing by the first of the clippingsurfaces, to the input, then clipping processing in accordance with thenext clipping surface is performed on this returned data

After clipping processing has been performed in this manner inaccordance with a previously determined sequence of clipping surfaces,the perspective projection conversion is performed, the internal loop isremoved, and data is output to the next-stage output format conversionsection 421.

Note that the mode in which an internal loop of this type is formed,previously processed data is returned to the input, and clippingprocessing and perspective projection conversion are sequentiallyperformed thereon is called re-entrant mode.

An example of the above described processing by using a plurality of theclipping processing device is shown in FIG. 6C. In this case, forexample, clipping processing by a first three clipping surfaces isperformed by a first-stage clipping processing device 420a, and clippingprocessing by the remaining three surfaces and perspective projectionconversion is performed by a second-stage clipping processing device420b. If clipping processing devices are connected in series in thismanner and processing between these clipping processing devices isperformed by pipeline processing, the speed of clipping processing canbe greatly increased. However, note that in this case the number ofclipping processing devices would increase, but from the point of viewof hardware savings, it is advantageous to perform the clippingprocessing with only one clipping processing device.

In the priority register 170 is stored data that specifies in whatclipping surface sequence the clipping processing is to be performedwithin the clipping processing device. To be specific, index data thatspecifies clipping surfaces for performing clipping processing is storedin the sequence in which processing is to be performed.

The initial-value setting section 152 is intended to set an initialvalue in this priority register 170, and the setting of this initialvalue is performed in accordance with initial mode specification dataand priority specification data that is selected and input by theselector 150. In this case, the initial mode specification data is datathat is set at a reset of the entire 3D simulator device. The priorityspecification data is data included within the object data shown in FIG.4, and enables the specification of clipping surface priorities in unitsof 3D object.

An example of this initial mode specification data and priorityspecification data is shown in FIG. 7A. This data consists of, forexample, 8-bit data, where bits 0 to 6 are used to specify clippingsurfaces and bit 7 is used to specify whether or not perspectiveprojection conversion is to be performed. A 0 in a bit means that thespecification is not performed; a 1 means that it is performed. Thesequence of clipping processing and perspective projection conversionprocessing is specified in sequence from the least significant bit (LSB)of the bits shown in FIG. 7A.

With the initial mode specification data set as shown in FIG. 7A, bits1, 2, 3, and 7 being 1 means that clipping processing is performed inthe sequence of clipping surfaces 1, 2, and 3 then perspectiveprojection conversion is performed and output.

Note that at most six clipping surfaces are sufficient for clippingprocessing for a 3D space, as shown in FIG. 19. However, this embodimentis configured in such a manner that it is possible to have clippingprocessing with up to seven surfaces, as shown in FIG. 7A. This isuseful for producing visual effects such as having a character in a gamedisappear into a wall or the like, when the 3D simulator device isapplied to a game. In other words, it is possible to produce the visualeffect of a character disappearing into such a wall by setting theremaining clipping surface to be this wall.

When the power of the 3D simulator device is turned on, the initial modespecification data is input to the initial-value setting section 152. Ifthe initial mode specification data is the data whose contents are shownin FIG. 7A, for example, the priority register 170 is set by theinitial-value setting section 152 to the initial state shown in FIG. 7B(the sequence of 1, 2, 3, then 7). This ensures that clipping processingis performed for the first polygon in the sequence of clipping surfaces1, 2, and 3, and finally perspective projection conversion is performed.

Assume that, in this case, clipping-out of a certain polygon is causedby clipping surface 2. When that happens, the processing by the clippingprocessing device 420 is halted and the data written in the priorityregister 170 is modified by the priority modification section 160. To bespecific, clipping surface 2 is placed at the head of the contents ofthe priority register 170 and the processing position for clippingsurface 1 is moved one step downward, so that, as a result, theprocessing sequence is modified to surfaces 2, 1, 3, then 7. This meansthat the clipping processing with respect to the next polygon isperformed in the sequence of clipping surfaces 2, 1, and 3.

If clipping-out then occurs with clipping surface 3, the contents of thepriority register 170 are modified to the sequence of 3, 2, 1, then 7,as shown in FIG. 7D.

When this clipping processing with respect to all the polygonsconfiguring the 3D object has ended, the priority specification datacorresponding to the next 3D object to be processed is set in thepriority register 170 through the initial-value setting section 152.Note, however, that the initial value of this priority specificationdata for each 3D object can be any value, and it is not always necessaryto set this value for every 3D object. If it is not set, clippingprocessing for the subsequent polygon is performed according to thecontents of the priority register 170 that were set at the end of theprevious round.

This priority specification data is included in the object data; morespecifically, it is stored as accompanying data for each 3D objectwithin the 3D image information memory section 416 of FIG. 2. Thispriority specification data could also be previously set by a programthat creates a virtual 3D space, for example. Locations arranged withinthe virtual 3D space are, to a certain extent, predetermined, and thusif priority specification data could be set with respect to a 3D objectfor a clipping surface that causes clipping that can be anticipated to acertain degree from the first, it would be possible to implement anincrease in clipping processing speed.

2) Application Examples

The above described methods implement a huge increase in clippingprocessing for this embodiment, but further discussion of whether thesemethods are effective in increasing the clipping processing speed isgiven below with reference to FIGS. 8A to 8D.

To simplify the description, the examples shown in FIGS. 8A to 8Dconcern clipping processing within a 2D space. In these figures, assumethat a region bounded by clipping surfaces 1 to 4 is the display region20. Conversely, assume that a region outside the display region 20 iscalled an out-of-display region 18. A region on the boundary of theclipping surfaces 1 to 4 is a boundary region 19.

First consider a case in which clipping processing is performed in thesequence of clipping surfaces 1, 2, 3, and 4 for a polygon 32configuring a 3D object 30 in FIG. 8A. In this case, since it isdetermined that all vertices of the polygon 32 are within the displayregion 20 by the clipping processing for the clipping surfaces 1, 2, and3, these vertices are not clipped out by these clipping surfaces.Therefore, three time units are necessary up to that point in this case.However, since it will be determined that all of the vertices of thepolygon 32 are in the out-of-display region 18 with respect to the nextclipping surface 4, this will cause the polygon 32 to be clipped out. Asa result, this clipping processing requires a total of four time units.

However, only the processing for the final clipping surface 4 isactually necessary, so that other processing is completely wasted.Therefore, means of reducing this unnecessary processing has become asubject of research.

An object (3D object) has a constant size as one of the generalproperties thereof, and thus it is possible to state that polygons thatconfigure the same 3D object are statistically "close." In other words,if one polygon that configures a 3D object is clipped out by a certainclipping surface, it can be said to be highly likely that other polygonsconfiguring the same 3D object will also be clipped out by that clippingsurface. Therefore, when a certain polygon has been clipped out by theclipping surface 4, if the other polygons within the same object couldbe subjected to clipping processing starting from that clipping surface,it is possible that the processing time will be statistically reduced.

The description below concerns the application of this method to anarrangement of the 3D object 30 shown in FIG. 8A. If a polygon 32thereof is clipped out by the clipping surface 4, the contents of thepriority register 170 are changed to the sequence of 4, 1, 2, 3, then 7,as shown in FIG. 8B. Therefore, clipping processing for the next polygon34 starts from clipping surface 4, and that polygon is clipped out atthe start. Thus three time units are saved. In the same manner, threetime units are saved for each of polygons 36 and 38. The processing timefor the first polygon 32 is no different from that when this method isnot used, but there is absolutely no wastage in processing time with thesecond and subsequent polygons 34 and 38, so that each takes one timeunit. This means that, if the number of polygons is sufficiently high,the time necessary for processing the 3D object 30 is reduced toapproximately 1/4 in comparison with the case in which this method isnot used.

The description below concerns the application of this method to anarrangement of a 3D object 40 shown in FIG. 8C. If a polygon 42 thereofis clipped out by the clipping surface 4, the contents of the priorityregister 170 are changed to the clipping surface sequence of 4, 1, 2,then 3, as shown in FIG. 8D.

If an attempt is then made to perform clipping processing for a polygon44, for example, the polygon 44 is not clipped out by the clippingsurface 4 but it is clipped out by the clipping surface 2. Therefore,the contents of the priority register 170 are changed to the sequence of2, 4, 1, then 3. In this case, the clipping surface 4 that provided theprevious clipping-out is moved one step down. If an attempt is then madeto perform clipping processing for a polygon 46, for example, it is notclipped out by the clipping surface 2 but it is clipped out by theclipping surface 4 which is stored in the next step within the priorityregister 170. Therefore, although processing is not possible in theshortest time of one time unit, it can be performed in two time units,and thus a saving in processing time can be achieved.

Note that initialization of this embodiment can be performed withpriority specification data in which an optimal clipping surfacesequence is previously set for each 3D object as described above. Inother words, it is highly likely that the configuration of the createdvirtual 3D space will cause the 3D object 40 shown in FIG. 8C to beclipped out by the clipping surfaces 4 and 2, for example. In this case,if the priority specification data within the object data for the 3Dobject 40 is specified in such a manner that clipping surface processingsequence is 4, 2, 1, then 3, for example, the processing time necessaryduring the processing of the polygon 42 can be reduced.

The savings in processing time provided by this method are not limitedto the case of clipping processing performed sequentially for polygonswithin the same 3D object. For example, this method is also effectivefor saving on processing time when the sequence in which imageprocessing is performed is previously set by a games program or the likein such a manner that processing is in sequence starting from 3D objectsat positions that are as close as possible. To be specific, theprocessing sequence could be set by a games program or the like in sucha manner that 3D objects 60, 62, and 64 in FIG. 8E, which are mutuallyclose to each other, are processed in sequence. This ensures that thedata format shown in FIG. 4 and formed by the data formatting section417 creates the sequence of 3D objects 60, 62, then 64. With thisconfiguration, if the 3D object 60 is first of all clipped out by theclipping surface 4, it is highly likely that the 3D object 62 that isclose thereto will also be clipped out by the clipping surface 4, sothis method makes it possible to save on processing time.

3) Trivial Acceptance/Rejection

With the method described above, if all of polygons 52 to 58 of a 3Dobject 50 shown in FIG. 8E, for example, are within the display region20, a processing time of four time units is required for each of thesepolygons.

In this case, a trivial accept/reject method (hereinafter called trivialclipping processing) described below can be used in combination with theabove method.

The configuration used for this trivial clipping processing is shown inFIG. 9. As shown in this figure, the configuration further comprises apreprocessing section 280.

The preprocessing section 280 comprises a preprocessing decision section282 that performs an inside/outside decision by a trivial clippingsurface and a specification data generation section 284 that formsspecification data that is to be output to the initial-value settingsection 152, based on the decision result.

The operation of this preprocessing section 280 will now be describedwith reference to FIG. 10. To simplify the description, the applicationexample shown in this figure concerns clipping processing within a 2Dspace

First of all, the coordinates of representative points of the 3D object50 and an object length L are read out to the preprocessing decisionsection 282. Average values of the vertex coordinates of the 3D objectcould be used as the coordinates of these representative points. Themaximum length of the lengths between each pair of vertices of the 3Dobject could be used as the object length L. These representative pointsand object length L are set as part of the object data shown in FIG. 4.

These settings fake the 3D object 50 as a circle (or a sphere in a 3Dspace) with center coordinates that are the coordinates of theserepresentative points and radius L.

The preprocessing decision section 282 then sets a zone for trivialclipping formed by trivial clipping surfaces 11 to 4 and 21 to 24 (theshaded area in FIG. 10). It is then determined whether the 3D object 50that is faked as this circle (sphere) is within one of a boundary region27 that is a region on this zone, a display region 26 that is a regionon an inner side surrounded by this zone, or an out-of-display region 28that is a region on the outer side of this zone. In this case, thetrivial clipping surfaces 11 to 14 are clipping surfaces that are setjust a maximum length ML on the inner sides of the clipping surfaces 1to 4, and the trivial clipping surfaces 21 to 24 are clipping surfacesthat are set just the maximum length ML on the outer sides of theclipping surfaces 1 to 4. Note that the maximum length ML is the maximumof the object lengths L of all the 3D objects.

This inside/outside decision determines that the 3D object 50 in FIG.10, for example, is in the display region 26 and clipping processing isnot necessary for the polygons 52 to 58 configuring that 3D object 50.Therefore, in this case, specification data for which perspectiveprojection conversion is performed, not clipping processing, is formedby the specification data generation section 284 (such as data thatwould be 10000000 in FIG. 7A) and is output to the initial-value settingsection 152. The initial-value setting section 152 sets an initial valuefor the processing of this 3D object 50 in the initial-value settingsection 152, based on this specification data. As a result, data forpolygons 52 to 58 is subjected to only perspective projection conversionin the clipping calculation section 200 and is output therefrom.

In a similar manner, the 3D object 30 is determined by an inside/outsidedecision to be in the out-of-display region 28, and it is determinedthat it is not necessary to perform clipping processing on the polygons32 to 38. Therefore, in this case, specification data for which neitherperspective projection conversion not clipping processing is performedis formed in the specification data generation section 284 (such as datathat would be 00000000 in FIG. 7A) and is output to the initial-valuesetting section 152. An initial value for the processing of this 3Dobject 30 is set in the priority register 170 in accordance with thisspecification data. As a result, data for polygons 32 to 38 is notsubjected to any processing in the clipping calculation section 200.

In a further similar manner, the 3D object 40 is determined by aninside/outside decision to be in the boundary region 27, and it isdetermined that clipping processing is necessary for polygons 42 to 48.In this case, the specification data is not formed by the specificationdata generation section 284. Therefore, clipping processing for thepolygons 42 to 48 can be performed efficiently by the above describedmethod of sequentially modifying the priority.

By combining the method of sequentially modifying the priority and themethod of performing trivial clipping processing, as described above,this embodiment enables the execution of extremely efficient clippingprocessing. In other words, since only perspective projection conversionis needed for polygons that have been determined to be in the displayregion 26 by the preprocessing section 280, the processing is completedin only one time unit. Since there is no need for processing polygonsthat are in the out-of-display region 28, the processing time thereforis the time necessary for preprocessing. For polygons that are in theboundary region 27, processing can be performed in one or two time unitsfor most of the polygons, except for the polygon that is processedfirst, by the above method of sequentially modifying the priority.

4. Specific Examples

1) Priority Modification Section, Priority Register, etc.

A specific circuit configuration for the priority register 170 is shownin FIG. 11 and a specific circuit configuration of the prioritymodification section 160 is shown in FIG. 12, together with details ofthe connection states between blocks.

As shown in FIG. 11, the priority register 170 comprises eight 3-bitregisters 171 to 178 that store clipping surface priorities and ORcircuits 181 to 188 for enabling data write to these registers.

As shown in this figure, the registers 171 to 178 are connected inseries, are driven by a CLK signal, and are reset at power-on by a RESsignal. Input data DIN[2:0] is input to the head register 171.

If any of select signals SA[7:0] that are input to SA pins of theregisters is then asserted, a DA pin thereof is selected as input datato the corresponding register. This causes the output data from theprevious-stage register to be loaded into the selected register, and thedata shifts. If, on the other hand, the select signal SA[7:0] that isinput to the SA pin is negated, a DB pin thereof is selected as inputdata of that register. This causes the output data to be fed backunchanged as input to the same register, so that the previous data isheld unchanged in that register.

Note that, in this case, "assert" refers to a signal state such that apin turns on, and "negate" refers to a signal state such that the pinturns off.

An enable signal ENALL that is input from the control section 154 andload signals ENL[7:0] that are input from the priority modificationsection 160 are connected to the OR circuits 181 to 188. If the enablesignal ENALL is asserted, input of the load signals ENL[7:0] isinhibited and all of the registers 171 to 178 are put in a shift state.Conversely, if the enable signal ENALL is negated, input of the loadsignals ENL[7:0] is enabled.

The priority modification section 160 comprises a counter 162, a decoder164, an AND circuit 166, and a selector 168 as shown in FIG. 12.

The counter 162 is a 3-bit synchronous counter, it is driven by the CLKsignal, and it is reset at power-on by the RES signal. If a count enablesignal COEN is asserted, the counter is incremented at the next CLKsignal. If a clear enable signal CLEN is asserted, the counter iscleared in synchronization with the next CLK signal.

This counter 162 stores data indicating the number of the round ofclipping processing, when the device is in the above describedre-entrant mode. The description below takes as an example the clippingprocessing device 420a performing the third round of clippingprocessing, with the connection state shown in FIG. 6C. In other words,if polygon data that is to be processed is in a newly input state andthe data stored in the counter 162 is 000, the first round of clippingprocessing is performed on the polygon data in this state. When thefirst round of clipping processing ends, count enable signal COEN thatis input from the control section 154 is asserted, and the data storedin the counter 162 becomes 001. In a similar manner, when the secondround of clipping processing ends, the stored data becomes 010, and thethird round of clipping processing is performed with this state.Finally, when the third round of processing ends, the clear enablesignal CLEN is asserted and the stored data is once again cleared to000.

The counter 162 fulfills two functions with the above describedoperation, as described below. The first function is to specify theclipping surface that is to perform the current clipping processing (orperspective projection conversion mode). In other words, the output ofthe counter 162 is input to the reading section 190 as a 3-bit read codeREC[2:0]. The reading section 190 uses this read code REC[2:0] to selectone of the outputs Q0 to Q7 of the priority register 170 to becomeclipping surface specification data SAD[2:0]. This causes index dataspecifying the clipping surface that is to perform the current clippingprocessing (or perspective projection conversion mode) to be output tothe subsequent-stage clipping calculation section 200.

The second function of the counter 162 is to generate a signal forwriting to the priority register 170 when clip-out occurs. To bespecific, the output of the counter 162 is input to the decoder 164, asshown in FIG. 12. The decoder 164 generates an 8-bit write code WRC[7:0]shown in FIG. 13A from the 3-bit data input from the counter 162. Thiswrite code WRC[7:0] is input as a load signal ENL[7:0] to the priorityregister 170 through the AND circuit 166. The priority registerdetermines from this load signal ENL[7:0] which of the registers is tobe written to.

The selector 168 has the function of selecting either the initial valuethat is input from the initial-value setting section 152 or the clippingsurface specification data SAD[2:0] (to be specific, data specifying theclipping surface that initiated clipping-out) that was output from theread-out section 190.

The operation of this circuitry will now be described with reference toFIGS. 13B to 13D.

A) Initialization

In an initial state, in other words, at power-on or at the start ofprocessing of each 3D object, initial mode specification data (atpower-on) or priority specification data (at the start of 3D objectprocessing) is input to the initial-value setting section 152. At thispoint, assume that data 10101110 shown in FIG. 13B has been input to theinitial-value setting section 152. This means that clipping processingis to be performed with clipping surfaces 1, 2, 3, and 5, thenperspective projection conversion (7) is to be performed and output. Theinitial-value setting section 152 encodes this data as a 3-bit value andoutputs it to the selector 168. To be specific, values 111, 101, 011,010, and 001, in other words, 3-bit codes indicating 7, 5, 3, 2, and 1,are encoded.

A pin B of the selector 168 is selected by a control signal from thecontrol section 154, and the encoded data is input thereto. In thiscase, the signal that enables all of the signals from the controlsection 154 is set to ENALL=0. Therefore, as described above, all of theregisters 171 to 178 within the priority register 170 are put into ashift state. As a result, the data from the selector 168 is sequentiallyinput to the registers 171 to 178. In this example, 1 is set in theregister 171, 2 is set in the register 172, 3 is set in the register173, 5 is set in the register 174, and 7 is set in the register 175,while registers 176 to 178 are in an undefined state.

B) During Normal Operation

After the above described initialization has ended, clipping processingstarts. During normal operation, ENMASK is set to 0 and ENALL to 1. Thissets a state in which all the write codes WRC[7:0] are masked and allthe load signals ENL[7:0] are 0, so that all of the select signalsSA[7:0] are 0. As a result, all of the registers 171 to 178 are in ahold state and the above data 12357 is held unchanged.

The read code REC[2:0] that is the output from the counter 162 is thensequentially incremented. This leads to the outputs Q7 to Q1 of thepriority register 170 being sequentially selected by the reading section190 and, as a result, the clipping processing is performed in thesequence of clipping surfaces 1, 2, 3, then 5 for this example, andfinally perspective projection conversion (7) is performed.

C) If Clip-Out Occurs

Assume that a certain polygon is clipped out by clipping surface 3, forexample, during normal operation. When that happens, EMASK is set to 1by the control section 154, the AND circuit 166 is made conductive, andthe load signals ENL[7:0] as far as the clipping surface for which thecurrent clipping processing is being performed are asserted. To bespecific, ENL[7] to ENL[5] in FIG. 13C become 1. As a result, theregisters 171 to 173 are put in a shift state and the registers 174 to178 are put in a hold state.

A pin A of the selector 168 is selected so that the register 173 that isstoring specification data for the clipping surface 3 is connectedthrough the selector 168 to the first-stage register 171, as shown inFIG. 13C.

Since the registers 171 to 173 are shifted at the next clock signal, thesequence of data stored in the registers 171 to 173 is changed from 1,2, then 3 to 3, 1, then 2, as shown in FIG. 13D. In other words, thedata specifying the clipping surface for which the current clippingprocessing is being performed is loaded in the first-stage register andthe specification data of which sequence is shifted one step down isloaded from the second-stage register until the register for the currentclipping processing.

Note that, since the perspective projection conversion processing mustalways be performed after all of the clipping processing has ended,EMASK is 0 and the contents of the priority register 170 are notmodified during the perspective projection conversion processing.

If, for example, a certain polygon is clipped out by the clippingsurface 3, the above operation enables the implementation of a hugeincrease in the speed of clipping processing by starting the processingof the next polygon from that clipping surface 3. In this case, thesequence of clipping surfaces is moved one step downward. This meansthat a clipping surface that caused a previous clip-out is moveddownward to the second position. Since it is highly likely thatclipping-out will occur with the clipping surface at the next position,even if the clipping-out does not occur with the uppermost clippingsurface, it is possible to implement faster, optimized clippingprocessing.

2. Clipping Calculation Section

The configuration and the operation of the clipping calculation section200 will now be described.

The clipping processing method of this embodiment will first bedescribed with reference to FIG. 14. This figure shows the clipping of apolygon 70 by a clipping surface 1. In this figure, V0=(X0, Y0, Z0),V1=(X1, Y1, Z1), V2=(X2, Y2, Z2), and V3=(X3, Y3, Z3) are vertexcoordinates of the polygon 70 and h(V)=aX+bY+cZ+d is the plane equationof the clipping surface 1.

A) Inside/Outside Decision for Each Set of Vertex Coordinates

Simultaneously with the input of polygon data, an inside/outsidedecision is executed to determine whether vertex coordinates V0 to V3are in a region outside the clipping surface 1 or in a region withinthat surface. For this purpose, the following calculations are firstperformed:

    h(V0)=aX0+bY0+cZ0+d

    h(V1)=aX1+bY1+cZ1+d

    h(V2)=aX2+bY2+cZ2+d

    h(V3)=aX3+bY3+cZ3+d

According to the above calculations, Vn is determined to be in thedisplay region if h(Vn) is less than or equal to zero, or Vn isdetermined to be in the out-of-display region if h(Vn) is greater thanzero. In the example shown in FIG. 14, since h(V0) and h(V3) are bothgreater than 0, it is determined that V0 and V3 are in theout-of-display region, whereas, since h(V1) and h(V2) are less than orequal to 0, it is determined that V1 and V2 are in the display region.

B) Interior-Division-Point Calculation

For a polygon 72 in FIG. 14 for which it has been determined that allvertices are in the display region, the configuration is such that allvertices are supplied as is to the next process (such as clippingprocessing and/or perspective projection conversion for the next plane).For a polygon 74 for which it has been determined that all vertices arein the out-of-display region, all vertices are excluded from the nextprocess.

In contrast thereto, clipping points, in other words, interior divisionpoints(divided points) Vk and Vl, are obtained for the polygon 70 thathas been clipped by the clipping surface 1. Vertices V0 and V3 areexcluded from the subsequent processing, and interior division points Vkand Vl are made vertices of the polygon 70 instead and these are used inthe subsequent processing.

To obtain the interior division points Vk and Vl, interior divisionratios tk and tl are obtained from the following equations:

    tk=(|h(V0)|)/(|h(V1)-h(V0)|)

    tl=(|h(V2)|)/(|h(V3)-h(V2)|)

These interior division ratios tk and tl are then used to obtain theinterior division points Vk and Vl from the following equations:

    Vk=V0+tk(V1-V0)

    Vl=V2+tl(V3-V2)

The above interior-division-point calculations were all described withreference to an example of calculating the interior division points forvertex coordinates, but interior division points for vertex texturecoordinates or vertex brightness information could also be obtained byclipping with this embodiment. Concerning the number of vertices of thepolygons, the above description used an example of polygons with fourvertices, but this embodiment is not limited thereto and it can beapplied to clipping processing for polygons having any number n ofvertices. In such a case, the above equations can thus be expressed bythe following general equation to obtain output data Wout:

    Wout=Wa+ti(Wb-Wa)

W: Clipping for any one of vertex brightness coordinates I0 to In;vertex texture coordinates TX0, TY0 to TXn, TYn; or vertex coordinatesX0, Y0, Z0 to Xn, Yn, Zn

a, b: Point numbers between two points that are to be clipped

ti: The interior division ratio at that point

Note that the calculation for data that is supplied unchanged to thenext process, without being subjected to clipping processing, isperformed with ti=0 in the above equation.

Note also that the clipping processing device performs theinside/outside decision and the interior-division-point calculation bypipeline processing to increase in speed.

C. Configuration and Operation of Clipping Calculation Section

The clipping calculation section 200 is configured to comprise aninside/outside decision section 210, an interior-division-pointcalculation section 230, and an output multiplexer 260, as shown in FIG.15.

In this embodiment, the calculation processing of this inside/outsidedecision section 210 and that of the interior-division-point calculationsection 230 are performed by pipeline processing. Inside/outsidedecision calculations are sequentially performed on the input polygondata by the inside/outside decision section 210, and the latest datathat is to be subjected to the interior-division-point calculation iscontrolled in such a manner that it is output to theinterior-division-point calculation section 230. This control method isused for the reasons given below. The number of polygons to be subjectedto the interior-division-point calculation in this type of 3D simulatordevice is always changing with the player's control state. However,since divisions and other calculations are performed by theinterior-division-point calculation section 230, this section requiresmore calculation processing time than the inside/outside decisionsection 210. Therefore, to perform the calculation processing at theoptimum speed under such conditions, it is necessary to control theinside/outside decision section 210 in such a manner that the latestdata can always be output to the interior-division-point calculationsection 230.

The clipping processing device 420 according to this embodiment canperform clipping processing for a plurality of clipping surfaces with asingle clipping processing device by using the previously mentionedre-entrant mode. In this case, clipping processing can be performed by aplurality of clipping surfaces for the same polygon by the outputmultiplexer 260 re-inputting polygon data for which clipping processinghas ended to an input section 212

The inside/outside decision section 210 comprises the input section 212,a polygon data register 214, a plane equation calculation section 216,and a clipping specification section 218.

The data necessary for the clipping calculation section 200 is extractedby the input section 212 from the input frame data, object data, polygondata from the coordinate conversion section 418, and is subjected tovarious forms of data format conversion.

For example, details of the monitor that is to display the image, suchas its angle and size, are extracted from the frame data, leading to theextraction of coefficients of the plane equations for performing theclipping. Data necessary for the processing of each object is alsoextracted from the object data. Further data, such as the vertexcoordinates, vertex texture coordinates, and vertex brightnessinformation of the polygons, is extracted from the polygon data, this issubjected to the necessary data format conversion, then the vertexcoordinates are output to the plane equation calculation section 216 andthe data such as the vertex coordinates, vertex texture coordinates, andvertex brightness information is output to the polygon data register214.

The data input from the input section 212, such as vertex coordinates,vertex texture coordinates, and vertex brightness information, issequentially stored in the polygon data register 214, then data isoutput to the interior-division-point calculation section 230 or theoutput multiplexer 260 in accordance with specifications from theclipping specification section 218.

An inside/outside decision is performed by the plane equationcalculation section 216 for each of the vertex coordinates Vn of thepolygons in accordance with the equation given below. The coefficientsa, b, c, and d are set by the frame data. The decision as to whichclipping surface plane equation is to be used for the calculations, inother words, which sequence of clipping surfaces is to be used for thecalculations, is determined by data read from the reading section 190.

    h(Vn)=aXn+bYn+cZn+d

According to the above calculation, Vn is determined to be in thedisplay region if h(Vn) is less than or equal to zero, or Vn isdetermined to be in the out-of-display region if h(Vn) is greater thanzero.

Index data for each polygon vertex of the display region orout-of-display region is stored by the clipping specification section218. If it is determined that all the vertices of a polygon are in theout-of-display region, a specification that the polygon data is to beignored is set in the polygon data register 214.

If it is determined that all the vertices are within the display region,a specification that that polygon data is to be output to the outputmultiplexer is set in the polygon data register 214.

If it is determined that the polygon is in the boundary region of aclipping surface, in other words, if it is determined that the polygonis divided by the clipping surface, a specification that the polygondata is to output to the interior-division-point calculation section 230is set in the polygon data register 214. In this case, h(Vm) and h(Vn)(hereinafter called hm and hn) that were calculated by the planeequation calculation section 216 are output to theinterior-division-point calculation section 230.

Note that other necessary data, such as control data within theinterior-division-point calculation section 230, is also generated bythe clipping specification section 218. If the current mode is one inwhich perspective projection conversion is performed, variousspecifications are given such that the calculations by theinterior-division-point calculation section 230 become perspectiveprojection conversion calculations.

The interior-division-point calculation section 230 comprisesabsolute-value calculation sections 232 and 234, a division section 240,a subtraction section 242, a 0-mask section 244, a 1-mask section 246, amultiplication section 248, and an addition section 250.

The values of both |hm-hn| and |hm| are calculated by the absolute-valuecalculation sections 232 and 234 from hm and hn output from the clippingspecification section 218, then these values are output to the divisionsection 240. The interior division ratio ti=|hm|/|hm-hn| is calculatedfrom this data by the division section 240 and it is output to themultiplication section 248.

The value of (Wb-Wa) is calculated by the subtraction section 242 fromthe polygon data Wa and Wb that is input from the polygon data register214 and it is output to the multiplication section 248. Note that thesedata items Wa and Wb are not just polygon vertex coordinates; they alsoinclude vertex texture coordinates and vertex brightness information.This is because this data will be necessary for the subsequent imageprocessing when the polygon is divided.

The value of ti(Wb-Wa) is then calculated from these values of ti and(Wb-Wa) by the multiplication section 248 and it is output to theaddition section 250.

The following value is calculated by the addition section 250 from thesevalues of Wa and ti(Wb-Wa):

    Wout=Wa+ti(Wb-Wa)

Thus the interior division points are obtained.

Note that the calculations by the interior-division-point calculationsection 230 are not limited to interior-division-point calculations;perspective projection conversion calculation can also be performed. Insuch a case, Wa and h are selected by selectors 236 and 238,respectively, and each data item is set to either 0 or 1 by masking thecorresponding data by the 0-mask section 244 and the 1-mask section 246.This sets Wa=0, Wb-Wa=1, and ti=h/Wa in the above equation to calculate:

    Wout=h/Wa

and thus the perspective projection conversion is performed. In thismanner, perspective projection conversion can also be performed by thisembodiment by making use of the circuit configuration forinterior-division-point calculations. Therefore it is not necessary toprovide a new circuit for performing perspective projection conversion,which can greatly reduce the hardware. This has the particular advantageof enabling common use of large circuits such as the division section240.

The calculation result Wout of the interior-division-point calculationsection 230 is input to the output multiplexer 260. If there is stillsome clipping processing to be performed on that polygon with otherclipping surfaces, the calculation result returns to the input section.This operation repeats until the processing for all the clippingsurfaces stored in the priority register and the perspective projectionconversion has ended. When the processing for the final clipping surfaceor the perspective projection conversion ends, data is output to thenext-stage output format conversion section 421.

3. Increase in Processing Speed by Priority Modification and ParallelConnection

Clipping processing performed by a prior-art clipping processing deviceis shown in FIG. 16A. In this prior art, five clipping processingdevices 400a to 400e and a perspective projection conversion circuit 402are connected in series to perform clipping processing (for clipping byfive surfaces). Assume in the description below that the processing timein this case is one time unit.

In contrast, the clipping processing device in accordance with thisembodiment can execute the processing with a single clipping processingdevice, as shown in FIG. 16B. Depending on the state of the image to beprocessed, the processing could be performed by a plurality of clippingprocessing devices, such as two clipping processing devices 420a and420b, as shown in FIG. 16C. The description below concerns how theclipping processing device according to this embodiment can be effectivefrom the speed point of view.

With the clipping processing device according to this embodiment, theconfiguration could be such that six clipping processing devices 420a to420f are connected in parallel, as shown in FIG. 16D, to provideparallel processing of polygon data. With this type of connection,processing can still be performed by the same number of clippingprocessing devices as that required for the prior-art clippingprocessing of FIG. 16A.

With the configuration of FIG. 16D, if it is determined by using thetrivial acceptance/rejection method that clipping is not necessary forall of the polygons and only perspective projection conversion isnecessary, for example, clipping processing can be performed at a speedthat is six times that of the prior art. Even if this ideal state doesnot occur, this connection configuration is still extremely effectivefor increasing processing speed, as will be described below.

For example, if the 3D simulator device of this invention is applied toa game, this does not mean that the clipping processing of polygonswithin the game must be applied for all of the polygons and by all ofthe clipping surfaces. Variations due to the state of the images couldproduce the following ratios:

Clipping processing is not necessary: 70%

Clipping processing by one surface is necessary: 20%

Clipping processing by two surfaces is necessary: 8%

Clipping processing by three or more surfaces is necessary: 2%

Rough estimates of the time require for clipping processing in this caseare given below. In other words, if the above ratios of time taken arerated from P0 (clipping processing is not necessary, only perspectiveprojection conversion is performed) to P5 (clipping processing by fivesurfaces is necessary, including perspective projection conversion), thetime taken by clipping processing can be expressed as:

    1×P0+2P1+3P2+6P5                                     (k)

Note that, in order to simplify the description, clipping with three ormore surfaces is totalled as clipping by five surfaces.

If the above typical ratios are substituted, Equation (k) becomes:

    1×0.7+2×0.2+0.08+6×0.02=1.46

If this is divided between six clipping processing devices connected inparallel:

    1.46/6=0.233

Since one time unit is required by the prior-art clipping processingdevice of FIG. 16A, the processing speed becomes approximately 4.1 timesthat speed.

The point should be noted that the number of clipping processing deviceshas not changed in comparison with FIG. 16A. Enabling of this speeddepends on dynamic changes in the details of polygon clippingprocessing. But, in the worst case in which clipping is necessary forall of the polygons, this difference in speed completely disappears incomparison with the configuration of FIG. 16A.

However, even in such a case, a drop in processing speed can beprevented by the use of the previously described function that modifiespriorities internally. This is described below.

Consider a case in which clipping processing is necessary for allpolygons, using three surfaces. This could occur for one 3D objectformed of a plurality of polygons. Up until the present it has beennecessary to perform the processing for this case in four loops(including perspective projection conversion), but the processing speedis only increased by 6/4=1.5 times in comparison with the configurationof FIG. 16A. However, it is considered that 95% of the processedpolygons are clipped out by one surface in practice. This occursfrequently when clipping processing is actually performed. Assume as acondition that the first polygon not to be clipped out is aligned andthe clipped-out polygon is aligned subsequently.

In this case, a time of four times is necessary for the clipped-outfirst polygon. However, use of the previously describedpriority-modification method ensures that the next polygon is processedfirst of all by the clipping surface that caused that clipping-out, sothat only one time unit is necessary. Assuming that the number ofpolygons is sufficiently large, the processing time in this case isgiven by:

    0.05×4+0.95×1=1.15

In comparison with the case in which the priorities of clipping surfacesare not changed, this gives:

    4/1.15=3.4 (times)

And in comparison with the configuration of FIG. 16A:

    1.5×3.4=5.1 (times)

Thus a value that is pretty close to the ideal state (6 times) isobtained.

In other words, even when conventional processing would by delayed, useof this clipping surface priority modification function makes itpossible to substantially avoid such delays.

Note that the present invention is not limited to the above describedembodiments; it can be embodied in many different ways within the scopeof the invention.

For example, the calculation method used for the clipping processingperformed by the clipping calculation section in accordance with thisinvention is not limited to the above described calculation method;calculation methods using various different types of algorithm could beused instead.

Further, the priority memory means of this invention is not limited toregisters configured of flip-flops or the like; any memory means such asSRAM or DRAM could be used, provided that at least priorities (indexdata) can be stored thereby.

The 3D simulator device of this invention can be applied to variousdifferent purposes, such as an arcade games machine, a familycomputer(domestic) games machine, a flight simulator, or a drivingsimulator as used in a driving school. It can also be applied to alarge-scale attraction type of game device or simulator in which anumber of players participate.

The calculation processing performed by components such as the virtual3D space calculation means, image synthesis means; and clippingprocessing device that have been described above with respect to thisinvention could be performed by a dedicated (custom made) imageprocessing device, or it could be performed by software means such as ina general-purpose (standard type) microprocessor or DSP.

Furthermore, the calculation processing performed by the virtual 3Dspace calculation means and image synthesis means is not limited to thecalculations described with respect to this embodiment.

In addition, the 3D simulator device to which this invention is appliedincludes a configuration in which the image is displayed on a displaymeans known as a head-mounted display (HMD).

What is claimed is:
 1. A clipping processing device for performingclipping processing using a plurality of clipping surfaces on athree-dimensional object represented by a plurality of polygons,comprising:a priority memory means for storing clipping surfacepriorities which has a storage means for storing index data specifyingsaid clipping surfaces to be used in clipping processing and stores saidindex data in a sequence in which clipping processing is executed,starting at an uppermost storage location of said storage means andproceeding downward; an initial-value setting means for setting aninitial value for said index data with respect to said priority memorymeans; a reading means for reading said index data of said clippingsurface from said priority memory means; a priority modification meansfor modifying said index data that has been read by said reading meansand rewriting modified data to said priority memory means; and aclipping calculation means for performing clipping calculation withrespect to a polygon to be processed, using said clipping surfacesspecified by said index data read out by said reading means in sequencefrom the uppermost storage location of said storage means; wherein:saidclipping calculation means comprises inside/outside decision means fordetermining whether said polygon to be processed is in one of a displayregion, a boundary region, or an out-of-display region of said clippingsurfaces; an interior-division-point calculation means for calculatinginterior division points between said polygon and said clipping surfacewhen said inside/outside decision means determines that said polygon isin said boundary region; and means for performing calculation processingthat invalidates said polygon when said inside/outside decision meansdetermines that said polygon is in said out-of-display region; and saidpriority modification means comprises means for transferring index dataof said clipping surface to the uppermost storage location of saidstorage means when said clipping calculation means determines that saidpolygon to be processed is in the out-of-display region of said clippingsurface.
 2. The clipping processing device as defined in claim 1,wherein:said priority modification means comprises means fortransferring index data of said clipping surface to the uppermoststorage location of said storage means, and also transferring index datathat have been stored in starting from said uppermost storage locationand ending one position higher than an original location of said indexdata to be transferred to the uppermost storage location sequentiallydownwards to lower storage locations, when said clipping calculationmeans determines that said polygon to be processed is in saidout-of-display region of said clipping surface.
 3. The clippingprocessing device as defined in claim 2, further comprising:means forperforming preprocessing for the entirety of a three-dimensional object,before clipping processing is performed on a polygon that configuressaid three-dimensional object; wherein said preprocessing meanscomprises:preprocessing decision means for setting a zone for trivialclipping of a given width shaped in such as manner as to include saidclipping surface, and determining whether said three-dimensional objectis in any of a display region, a boundary region, or an out-of-displayregion of said zone; and means for omitting clipping processing for apolygon that configures the three-dimensional object when saidpreprocessing decision means determines that said three-dimensionalobject is in said display region or out-of-display region of said zone,and for specifying that clipping processing is performed for a polygonthat configures the three-dimensional object when it is determined thatsaid three-dimensional object is in said boundary region of said zone.4. The clipping processing device as defined in claim 3, wherein:saidinterior-division-point calculation means within said clippingcalculation means comprises means for performing perspective projectionconversion with respect to a polygon to be processed, by modifyingcalculation coefficients that are used in interior-division-pointcalculation.
 5. The clipping processing device as defined in claim 4,further comprising:means for setting said initial value set by saidinitial-value setting means for each three-dimensional object configuredof polygons, in accordance with a display state of saidthree-dimensional object.
 6. The clipping processing device as definedin claim 3, further comprising:means for setting said initial value setby said initial-value setting means for each three-dimensional objectconfigured of polygons, in accordance with a display state of saidthree-dimensional object.
 7. The clipping processing device as definedin claim 2, wherein:said interior-division-point calculation meanswithin said clipping calculation means comprises means for performingperspective projection conversion with respect to a polygon to beprocessed, by modifying calculation coefficients that are used ininterior-division-point calculation.
 8. The clipping processing deviceas defined in claim 7, further comprising:means for setting said initialvalue set by said initial-value setting means for each three-dimensionalobject configured of polygons, in accordance with a display state ofsaid three-dimensional object.
 9. The clipping processing device asdefined in claim 2, further comprising:means for setting said initialvalue set by said initial-value setting means for each three-dimensionalobject configured of polygons, in accordance with a display state ofsaid three-dimensional object.
 10. The clipping processing device asdefined in claim 1, further comprising:means for performingpreprocessing for the entirety of a three-dimensional object, beforeclipping processing is performed on a polygon that configures saidthree-dimensional object; wherein said preprocessing meanscomprises:preprocessing decision means for setting a zone for trivialclipping of a given width shaped in such as manner as to include saidclipping surface, and determining whether said three-dimensional objectis in any of a display region, a boundary region, or an out-of-displayregion of said zone; and means for omitting clipping processing for apolygon that configures the three-dimensional object when saidpreprocessing decision means determines that said three-dimensionalobject is in said display region or out-of-display region of said zone,and for specifying that clipping processing performed for a polygon thatconfigures the three-dimensional object when it is determined that saidthree-dimensional object is in said boundary region of said zone. 11.The clipping processing device as defined in claim 10, wherein:saidinterior-division-point calculation means within said clippingcalculation means comprises means for performing perspective projectionconversion with respect to a polygon to be processed, by modifyingcalculation coefficients that are used in interior-division-pointcalculation.
 12. The clipping processing device as defined in claim 11,further comprising:means for setting said initial value set by saidinitial-value setting means for each three-dimensional object configuredof polygons, in accordance with a display state of saidthree-dimensional object.
 13. The clipping processing device as definedin claim 10, further comprising:means for setting said initial value setby said initial-value setting means for each three-dimensional objectconfigured of polygons, in accordance with a display state of saidthree-dimensional object.
 14. The clipping processing device as definedin claim 1, wherein:said interior-division-point calculation meanswithin said clipping calculation means comprises means for performingperspective projection conversion with respect to a polygon to beprocessed, by modifying calculation coefficients that are used ininterior-division-point calculation.
 15. The clipping processing deviceas defined in claim 14, further comprising:means for setting saidinitial value set by said initial-value setting means for eachthree-dimensional object configured of polygons, in accordance with adisplay state of said three-dimensional object.
 16. The clippingprocessing device as defined in claim 1, further comprising:means forsetting said initial value set by said initial-value setting means foreach three-dimensional object configured of polygons, in accordance witha display state of said three-dimensional object.
 17. Athree-dimensional simulator device comprising a clipping processingdevice as defined in claim 1, wherein said three-dimensional simulatordevice comprises:an image synthesis means for synthesizing afield-of-view image as seen from an observer within a virtualthree-dimensional space, using a polygon which has been subjected toclipping processing by said clipping processing device.
 18. A clippingprocessing method for performing clipping processing with respect to athree-dimensional object represented by a plurality of polygons, using apriority memory means for storing priorities of clipping surfaces to beused in clipping processing, wherein said clipping processing methodcomprises:an initial-value setting step for setting an initial value forsaid priorities of said clipping surfaces in said priority memory means;a determining step for determining whether a polygon to be processed isin one of a display region, a boundary region, or an out-of-displayregion of said clipping surface, using said clipping surfaces insequence from a clipping surface with the highest priority stored insaid priority memory means; a clipping calculation step for calculatinginterior division points between a polygon and a clipping surface whensaid determining step determines that said polygon to be processed is insaid boundary region, and for performing calculation processing thatinvalidates said polygon when said determining step determines that saidpolygon is in said out-of-display region; and a modifying step formodifying the priorities in said priority memory means in such a mannerthat said clipping surface has the highest priority when said clippingcalculation step determines that said polygon to be processed is in saidout-of-display region of said clipping surface.
 19. The clippingprocessing method as defined in claim 18, further comprising a stepof:performing preprocessing for the entirety of a three-dimensionalobject, before clipping processing is performed on a polygon thatconfigures said three-dimensional object; wherein said preprocessingstep comprises the steps of:setting a zone for trivial clipping of agiven width shaped in such as manner as to include said clippingsurface, and determining whether said three-dimensional object is in anyof a display region, a boundary region, or an out-of-display region ofsaid zone; and omitting clipping processing for a polygon thatconfigures the three-dimensional object when said determining stepdetermines that said three-dimensional object is in said display regionor out-of-display region of said zone, and for specifying that clippingprocessing is performed for a polygon that configures thethree-dimensional object when said determining step determines that saidthree-dimensional object is in said boundary region of said zone. 20.The clipping processing method as defined in claim 18, wherein:saidinitial value set in said initial-value setting step is set for eachthree-dimensional object configured of polygons, in accordance with adisplay state of said three-dimensional object.